
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>统计算法的执行效率和资源消耗 · 👨🏽‍💻前端漫游指南</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="WuXiaolong">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="从Chrome V8源码看JavaScript数组.html" />
    
    
    <link rel="prev" href="前端算法.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                        <b>1.1.</b>
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Base/">
            
                <a href="../Base/">
            
                    
                        <b>1.2.</b>
                    
                    前端基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../Base/">
            
                <a href="../Base/">
            
                    
                        <b>1.2.1.</b>
                    
                    原生js系列
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1" data-path="../Base/手写call1.html">
            
                <a href="../Base/手写call1.html">
            
                    
                        <b>1.2.1.1.</b>
                    
                    类型转换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2" data-path="../Base/EventLoop.html">
            
                <a href="../Base/EventLoop.html">
            
                    
                        <b>1.2.1.2.</b>
                    
                    EventLoop
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../Base/CSS.html">
            
                <a href="../Base/CSS.html">
            
                    
                        <b>1.2.2.</b>
                    
                    CSS系列
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.2.1" data-path="../Base/布局系列.html">
            
                <a href="../Base/布局系列.html">
            
                    
                        <b>1.2.2.1.</b>
                    
                    布局系列
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../Design/">
            
                <a href="../Design/">
            
                    
                        <b>1.3.</b>
                    
                    前端设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../Design/工程模式.html">
            
                <a href="../Design/工程模式.html">
            
                    
                        <b>1.3.1.</b>
                    
                    工厂模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../Design/单一模式.html">
            
                <a href="../Design/单一模式.html">
            
                    
                        <b>1.3.2.</b>
                    
                    单一模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../DiyCode/">
            
                <a href="../DiyCode/">
            
                    
                        <b>1.4.</b>
                    
                    手撕代码
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../DiyCode/手写call.html">
            
                <a href="../DiyCode/手写call.html">
            
                    
                        <b>1.4.1.</b>
                    
                    手写call
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../DiyCode/手写bind.html">
            
                <a href="../DiyCode/手写bind.html">
            
                    
                        <b>1.4.2.</b>
                    
                    手写bind
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.5.</b>
                    
                    前端算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="前端算法.html">
            
                <a href="前端算法.html">
            
                    
                        <b>1.5.1.</b>
                    
                    前端算法
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.2" data-path="统计算法的执行效率和资源消耗.html">
            
                <a href="统计算法的执行效率和资源消耗.html">
            
                    
                        <b>1.5.2.</b>
                    
                    统计算法的执行效率和资源消耗
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="从Chrome V8源码看JavaScript数组.html">
            
                <a href="从Chrome V8源码看JavaScript数组.html">
            
                    
                        <b>1.5.3.</b>
                    
                    从Chrome V8源码看JavaScript数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="LRU算法.html">
            
                <a href="LRU算法.html">
            
                    
                        <b>1.5.4.</b>
                    
                    LRU算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="链表原来如此简单.html">
            
                <a href="链表原来如此简单.html">
            
                    
                        <b>1.5.5.</b>
                    
                    链表原来如此简单
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../Vue/">
            
                <a href="../Vue/">
            
                    
                        <b>1.6.</b>
                    
                    Vue知识点
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../Vue/Proxy 基本使用与defineProperty.html">
            
                <a href="../Vue/Proxy 基本使用与defineProperty.html">
            
                    
                        <b>1.6.1.</b>
                    
                    Proxy 基本使用与defineProperty
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../Vue/面试题串讲_vue.html">
            
                <a href="../Vue/面试题串讲_vue.html">
            
                    
                        <b>1.6.2.</b>
                    
                    面试题串讲_vue
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../React/">
            
                <a href="../React/">
            
                    
                        <b>1.7.</b>
                    
                    React知识点
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../React/setState解析.html">
            
                <a href="../React/setState解析.html">
            
                    
                        <b>1.7.1.</b>
                    
                    setState解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../React/Fetch异步中止.html">
            
                <a href="../React/Fetch异步中止.html">
            
                    
                        <b>1.7.2.</b>
                    
                    Fetch异步中止
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../React/面试题串讲_react.html">
            
                <a href="../React/面试题串讲_react.html">
            
                    
                        <b>1.7.3.</b>
                    
                    面试题串讲_react
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../ReactNative/">
            
                <a href="../ReactNative/">
            
                    
                        <b>1.8.</b>
                    
                    ReactNative
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../ReactNative/RN分包机制.html">
            
                <a href="../ReactNative/RN分包机制.html">
            
                    
                        <b>1.8.1.</b>
                    
                    RN分包机制
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >统计算法的执行效率和资源消耗</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x7EDF;&#x8BA1;&#x7B97;&#x6CD5;&#x7684;&#x6267;&#x884C;&#x6548;&#x7387;&#x548C;&#x8D44;&#x6E90;&#x6D88;&#x8017;">&#x7EDF;&#x8BA1;&#x7B97;&#x6CD5;&#x7684;&#x6267;&#x884C;&#x6548;&#x7387;&#x548C;&#x8D44;&#x6E90;&#x6D88;&#x8017;</h1>
<h3 id="&#x7B80;&#x4ECB;">&#x7B80;&#x4ECB;</h3>
<p>&#x524D;&#x7AEF;&#x8FD8;&#x8981;&#x5B66;&#x7B97;&#x6CD5;&#xFF1F;&#x5FC5;&#x987B;&#x5B66;&#xFF0C;&#x800C;&#x4E14;&#x5FC5;&#x987B;&#x72E0;&#x72E0;&#x5730;&#x5B66;&#x3002;&#x73B0;&#x5728;&#x53BB;&#x5927;&#x5382;&#x9762;&#x8BD5;&#xFF0C;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E0E;&#x7B97;&#x6CD5;&#x5DF2;&#x7ECF;&#x662F;&#x6807;&#x914D;&#xFF0C;&#x8981;&#x662F;&#x4E0D;&#x4F1A;&#x7684;&#x8BDD;&#xFF0C;&#x90A3;&#x57FA;&#x672C;&#x4E0E;&#x5927;&#x5382;&#x65E0;&#x7F18;&#x4E86;&#x3002;</p>
<p>&#x4F5C;&#x4E3A;&#x4E00;&#x540D;&#x524D;&#x7AEF;&#xFF0C;&#x867D;&#x7136;&#x5728;&#x5E73;&#x5E38;&#x5F00;&#x53D1;&#x4E2D;&#x5F88;&#x5C11;&#x5199;&#x7B97;&#x6CD5;&#xFF0C;&#x4F46;&#x5F53;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x6DF1;&#x5165;&#x524D;&#x7AEF;&#x6846;&#x67B6;&#x3001;&#x5F00;&#x53D1;&#x8BED;&#x8A00;&#x3001;&#x5F00;&#x6E90;&#x5E93;&#x65F6;&#xFF0C;&#x61C2;&#x7B97;&#x6CD5;&#x5C06;&#x5927;&#x5927;&#x63D0;&#x9AD8;&#x6211;&#x4EEC;&#x770B;&#x6E90;&#x7801;&#x7684;&#x80FD;&#x529B;&#x3002;&#x4F8B;&#x5982; react &#x7684; diff &#x7B97;&#x6CD5;&#x3001;webpack &#x4E2D;&#x5229;&#x7528; tree-shaking &#x4F18;&#x5316;&#x3001;v8 &#x4E2D;&#x7684;&#x8C03;&#x7528;&#x6808;&#x3001;&#x6D88;&#x606F;&#x961F;&#x5217;&#x7B49;&#xFF0C;&#x8FD9;&#x4E9B;&#x5C31;&#x5927;&#x91CF;&#x4F7F;&#x7528;&#x4E86;&#x7B97;&#x6CD5;&#xFF0C;&#x770B;&#x61C2;&#x4E86;&#x5C31;&#x80FD;&#x66F4;&#x597D;&#x7684;&#x4E86;&#x89E3;&#x5B83;&#x4EEC;&#x7684;&#x6027;&#x80FD;&#xFF0C;&#x66F4;&#x9AD8;&#x6548;&#x7684;&#x89E3;&#x51B3;&#x95EE;&#x9898;&#xFF0C;&#x8FDB;&#x9636;&#x5230;&#x66F4;&#x9AD8; Level&#xFF0C;&#x8D5A;&#x66F4;&#x591A;&#x94B1;&#x3002;</p>
<p>&#x73B0;&#x5728;&#x5E02;&#x9762;&#x4E0A;&#x7684;&#x7B97;&#x6CD5;&#x8D44;&#x6599;&#x5F88;&#x591A;&#xFF0C;&#x4F46;&#x9488;&#x5BF9;&#x524D;&#x7AEF;&#x7684;&#x7B97;&#x6CD5;&#x8D44;&#x6599;&#x5C11;&#x4E4B;&#x53C8;&#x5C11;&#xFF0C;&#x6240;&#x4EE5;&#xFF0C;&#x8FD9;&#x91CC;&#x6211;&#x6574;&#x7406;&#x4E86;&#x4E00;&#x4EFD;&#x9002;&#x7528;&#x4E8E;&#x524D;&#x7AEF;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E0E;&#x7B97;&#x6CD5;&#x7CFB;&#x5217;&#xFF0C;&#x5E0C;&#x671B;&#x80FD;&#x5E2E;&#x52A9;&#x4F60;&#x4ECE;0&#x5230;1&#x6784;&#x5EFA;&#x5B8C;&#x6574;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E0E;&#x7B97;&#x6CD5;&#x4F53;&#x7CFB;&#x3002;</p>
<p>&#x672C;&#x7CFB;&#x5217;&#x9884;&#x4F30;&#x4E00;&#x5171;&#x6709;40&#x591A;&#x7BC7;&#xFF0C;&#x672C;&#x7BC7;&#x662F;&#x7B2C;&#x4E00;&#x7BC7;&#x3002;&#x60F3;&#x8981;&#x66F4;&#x591A;&#x66F4;&#x5FEB;&#x7684;&#x5B66;&#x4E60;&#x672C;&#x7CFB;&#x5217;&#xFF0C;&#x53EF;&#x4EE5;&#x5173;&#x6CE8;&#x516C;&#x4F17;&#x53F7;&#x300C;&#x524D;&#x7AEF;&#x74F6;&#x5B50;&#x541B;&#x300D;&#x548C;&#x6211;&#x7684;&#x300C;<a href="https://github.com/sisterAn/JavaScript-Algorithms" target="_blank">Github&#xFF08;&#x70B9;&#x51FB;&#x67E5;&#x770B;&#xFF09;</a>&#x300D;</p>
<h3 id="&#x4E00;&#x3001;&#x4E3A;&#x4EC0;&#x4E48;&#x5F15;&#x5165;&#x590D;&#x6742;&#x5EA6;&#x5206;&#x6790;">&#x4E00;&#x3001;&#x4E3A;&#x4EC0;&#x4E48;&#x5F15;&#x5165;&#x590D;&#x6742;&#x5EA6;&#x5206;&#x6790;</h3>
<p>&#x6211;&#x4EEC;&#x77E5;&#x9053;&#xFF0C;&#x597D;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E0E;&#x7B97;&#x6CD5;&#x80FD;&#x591F;&#x5927;&#x5927;&#x7F29;&#x77ED;&#x4EE3;&#x7801;&#x7684;&#x6267;&#x884C;&#x65F6;&#x95F4;&#x4E0E;&#x5B58;&#x50A8;&#x7A7A;&#x95F4;&#xFF0C;&#x90A3;&#x4E48;&#x6211;&#x4EEC;&#x5982;&#x4F55;&#x53BB;&#x8861;&#x91CF;&#x5B83;&#x5583;&#xFF1F;&#x672C;&#x8282;&#x5C31;&#x4E3B;&#x8981;&#x4ECB;&#x7ECD;&#x7B97;&#x6CD5;&#x6027;&#x80FD;&#x7684;&#x8861;&#x91CF;&#x6307;&#x6807;&#x2014;&#x590D;&#x6742;&#x5EA6;&#x5206;&#x6790;&#x3002;</p>
<p>==&#x5224;&#x65AD;&#x4E00;&#x6BB5;&#x4EE3;&#x7801;&#x6267;&#x884C;&#x7684;&#x6548;&#x7387;&#x6700;&#x7B80;&#x5355;&#x6700;&#x76F4;&#x89C2;&#x7684;&#x65B9;&#x5F0F;&#x5C31;&#x662F;&#x628A;&#x5B83;&#x653E;&#x5728;&#x673A;&#x5668;&#x4E0A;&#x6267;&#x884C;&#x4E00;&#x904D;&#xFF0C;&#x81EA;&#x7136;&#x5C31;&#x4F1A;&#x5F97;&#x5230;&#x7B97;&#x6CD5;&#x7684;&#x6267;&#x884C;&#x65F6;&#x95F4;&#x4E0E;&#x5360;&#x7528;&#x5185;&#x5B58;&#x5927;&#x5C0F;&#x3002;&#x90A3;&#x4E48;&#x4E3A;&#x4EC0;&#x4E48;&#x8FD8;&#x8981;&#x5F15;&#x5165;&#x590D;&#x6742;&#x5EA6;&#x5206;&#x6790;&#x5583;&#xFF1F;==</p>
<p>&#x8FD9;&#x4E3B;&#x8981;&#x662F;&#x56E0;&#x4E3A;&#xFF0C;&#x901A;&#x8FC7;&#x673A;&#x5668;&#x4E0A;&#x8FD0;&#x884C;&#x4EE3;&#x7801;&#x6765;&#x7EDF;&#x8BA1;&#x7B97;&#x6CD5;&#x7684;&#x6027;&#x80FD;&#xFF0C;&#x6709;&#x5F88;&#x5927;&#x7684;&#x5C40;&#x9650;&#x6027;&#xFF0C;&#x5B83;&#x5BB9;&#x6613;&#x53D7;&#x6D4B;&#x8BD5;&#x73AF;&#x5883;&#x3001;&#x6570;&#x636E;&#x89C4;&#x6A21;&#x5F71;&#x54CD;&#xFF1A;</p>
<ul>
<li>&#x7EDF;&#x8BA1;&#x7ED3;&#x679C;&#x6613;&#x53D7;&#x6D4B;&#x8BD5;&#x73AF;&#x5883;&#x5F71;&#x54CD;&#xFF1A;&#x4E0D;&#x540C;&#x7CFB;&#x7EDF;&#x3001;&#x5904;&#x7406;&#x5668;&#x7684;&#x673A;&#x5668;&#x6D4B;&#x8BD5;&#x7ED3;&#x679C;&#x53EF;&#x80FD;&#x51FA;&#x73B0;&#x5F88;&#x5927;&#x7684;&#x4E0D;&#x540C;</li>
<li>&#x7EDF;&#x8BA1;&#x7ED3;&#x679C;&#x6613;&#x53D7;&#x6570;&#x636E;&#x672C;&#x8EAB;&#x3001;&#x6570;&#x636E;&#x89C4;&#x6A21;&#x5F71;&#x54CD;&#xFF1A;&#x4E0D;&#x540C;&#x7684;&#x6570;&#x636E;&#x3001;&#x4E0D;&#x540C;&#x957F;&#x5EA6;&#x7684;&#x6570;&#x636E;&#x90FD;&#x53EF;&#x80FD;&#x5BF9;&#x6D4B;&#x8BD5;&#x7ED3;&#x679C;&#x4EA7;&#x751F;&#x5DE8;&#x5927;&#x7684;&#x5F71;&#x54CD;</li>
</ul>
<p>&#x800C;&#x8FD9;&#x4E9B;&#x90FD;&#x4E0D;&#x662F;&#x6211;&#x4EEC;&#x60F3;&#x8981;&#x770B;&#x5230;&#x7684;&#x3002;==&#x6211;&#x4EEC;&#x9700;&#x8981;&#x7684;&#x662F;&#x4E0D;&#x53D7;&#x5916;&#x5728;&#x56E0;&#x7D20;&#x5F71;&#x54CD;&#x7684;&#x3001;&#x5927;&#x81F4;&#x7684;&#x4F30;&#x8BA1;&#x7B97;&#x6CD5;&#x6267;&#x884C;&#x6548;&#x7387;&#x7684;&#x65B9;&#x6CD5;==&#x3002;&#x8FD9;&#x5C31;&#x662F;&#x4F7F;&#x7528;&#x590D;&#x6742;&#x5EA6;&#x5206;&#x6790;&#x7684;&#x539F;&#x56E0;&#x3002;</p>
<h3 id="&#x4E8C;&#x3001;&#x5982;&#x4F55;&#x8868;&#x793A;&#x590D;&#x6742;&#x5EA6;">&#x4E8C;&#x3001;&#x5982;&#x4F55;&#x8868;&#x793A;&#x590D;&#x6742;&#x5EA6;</h3>
<p>&#x5982;&#x4F55;&#x8868;&#x793A;&#x7B97;&#x6CD5;&#x590D;&#x6742;&#x5EA6;&#xFF0C;&#x5177;&#x4F53;&#x6765;&#x8BB2;&#x5C31;&#x662F;&#x4EE3;&#x7801;&#x6267;&#x884C;&#x7684;&#x65F6;&#x95F4;&#x3001;&#x6267;&#x884C;&#x6D88;&#x8017;&#x7684;&#x5B58;&#x50A8;&#x7A7A;&#x95F4;&#x3002;&#x4F8B;&#x5982;&#xFF1A;</p>
<pre class="language-"><code class="lang-js"><span class="token keyword">function</span> <span class="token function">cal</span><span class="token punctuation">(</span><span class="token parameter">n</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> sum <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> <span class="token comment">// 1 unit_time</span>
    <span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> <span class="token comment">// 1 unit_time</span>
    <span class="token keyword">for</span><span class="token punctuation">(</span><span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> n<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">// n unit_time</span>
        sum <span class="token operator">+=</span> i<span class="token punctuation">;</span> <span class="token comment">// n unit_time</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">return</span> sum
<span class="token punctuation">}</span>
</code></pre>
<p>&#x4ECE; CPU &#x7684;&#x89D2;&#x5EA6;&#x770B;&#xFF0C;&#x6BCF;&#x6BB5;&#x4EE3;&#x7801;&#x4E0D;&#x8FC7;&#x662F;&#x8BFB;&#x5199;&#x6570;&#x636E;&#x6216;&#x64CD;&#x4F5C;&#x6570;&#x636E;&#xFF0C;&#x5C3D;&#x7BA1;&#x6BCF;&#x6B21;&#x64CD;&#x4F5C; CPU &#x6267;&#x884C;&#x7684;&#x4E2A;&#x6570;&#x3001;&#x6267;&#x884C;&#x7684;&#x65F6;&#x95F4;&#x90FD;&#x4E0D;&#x540C;&#xFF0C;&#x4F46;&#x6211;&#x4EEC;&#x7C97;&#x54AF;&#x628A;&#x6BCF;&#x6B21;&#x6267;&#x884C;&#x7684;&#x65F6;&#x95F4;&#x90FD;&#x4E00;&#x81F4;&#xFF0C;&#x79F0;&#x4E3A; <code>unit_time</code> &#x3002;</p>
<p>&#x6240;&#x4EE5;&#x4E0A;&#x8FF0;&#x4EE3;&#x7801;&#x603B;&#x5171;&#x6267;&#x884C; <code>(2n+2)*unit_time</code> &#x65F6;&#x95F4;&#xFF0C;&#x5373;&#xFF1A;<code>T(n)=(2n+2)*unit_time</code> &#xFF0C;&#x6240;&#x4EE5;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5199;&#x6210;&#xFF1A;</p>
<pre class="language-"><code class="lang-js"><span class="token constant">T</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token constant">O</span><span class="token punctuation">(</span><span class="token function">f</span><span class="token punctuation">(</span>n<span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre>
<p>&#x5176;&#x4E2D;&#xFF1A;</p>
<ul>
<li>n&#xFF1A;&#x8868;&#x793A;&#x6570;&#x636E;&#x89C4;&#x6A21;&#x7684;&#x5927;&#x5C0F;</li>
<li>f(n)&#xFF1A;&#x8868;&#x793A;&#x6BCF;&#x884C;&#x4EE3;&#x7801;&#x6267;&#x884C;&#x7684;&#x6B21;&#x6570;&#x603B;&#x548C;</li>
<li>O&#xFF1A;&#x8868;&#x793A;&#x4EE3;&#x7801;&#x7684;&#x6267;&#x884C;&#x65F6;&#x95F4; T(n) &#x4E0E; f(n) &#x8868;&#x8FBE;&#x5F0F;&#x6210;&#x6B63;&#x6BD4;</li>
</ul>
<p>&#x5F53; n &#x5F88;&#x5927;&#x65F6;&#xFF0C;&#x4F8B;&#x5982; 10000&#xFF0C;&#x751A;&#x81F3;&#x66F4;&#x5927;&#xFF0C;<code>T(n) = O(f(n))</code> &#x53EF;&#x4EE5;&#x8868;&#x793A;&#x4E3A; <code>T(n) = O(n)</code> &#x3002;</p>
<p>&#x8FD9;&#x5C31;&#x662F;<strong>&#x5927; O &#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x8868;&#x793A;&#x6CD5;</strong>&#x3002;<strong>&#x5927; O &#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x5B9E;&#x9645;&#x4E0A;&#x5E76;&#x4E0D;&#x5177;&#x4F53;&#x8868;&#x793A;&#x4EE3;&#x7801;&#x771F;&#x6B63;&#x7684;&#x6267;&#x884C;&#x65F6;&#x95F4;&#xFF0C;&#x800C;&#x662F;&#x8868;&#x793A;&#x4EE3;&#x7801;&#x6267;&#x884C;&#x65F6;&#x95F4;&#x968F;&#x6570;&#x636E;&#x89C4;&#x6A21;&#x589E;&#x957F;&#x7684;&#x53D8;&#x5316;&#x8D8B;&#x52BF;</strong>&#xFF0C;&#x6240;&#x4EE5;&#xFF0C;&#x4E5F;&#x53EB;&#x4F5C;<strong>&#x6E10;&#x8FDB;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#xFF08;asymptotic time complexity&#xFF09;</strong>&#xFF0C;&#x7B80;&#x79F0;<strong>&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;</strong>&#x3002;</p>
<h3 id="&#x4E09;&#x3001;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;">&#x4E09;&#x3001;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;</h3>
<p>&#x5F53; n &#x65E0;&#x9650;&#x5927;&#x65F6;&#xFF0C;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6; <code>T(n)</code> &#x53D7; n &#x7684;&#x6700;&#x9AD8;&#x6570;&#x91CF;&#x7EA7;&#x5F71;&#x54CD;&#x6700;&#x5927;&#xFF0C;&#x4E0E;<code>f(n)</code> &#x4E2D;&#x7684;&#x5E38;&#x91CF;&#x3001;&#x4F4E;&#x9636;&#x3001;&#x7CFB;&#x6570;&#x5173;&#x7CFB;&#x5C31;&#x4E0D;&#x90A3;&#x4E48;&#x5927;&#x4E86;&#x3002;&#x6240;&#x4EE5;<code>&#x6211;&#x4EEC;&#x5206;&#x6790;&#x4EE3;&#x7801;&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x65F6;&#xFF0C;&#x4EC5;&#x4EC5;&#x5173;&#x6CE8;&#x4EE3;&#x7801;&#x6267;&#x884C;&#x6B21;&#x6570;&#x6700;&#x591A;&#x7684;&#x90A3;&#x6BB5;&#x5C31;&#x53EF;&#x4EE5;&#x4E86;</code>&#x3002;</p>
<p>&#x770B;&#x4E00;&#x4E2A;&#x4F8B;&#x5B50;&#xFF1A;</p>
<pre class="language-"><code class="lang-js"><span class="token keyword">function</span> <span class="token function">fun1</span><span class="token punctuation">(</span><span class="token parameter">n</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> sum <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span>i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> 
    <span class="token keyword">for</span><span class="token punctuation">(</span><span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> n<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        sum <span class="token operator">+=</span> i<span class="token punctuation">;</span> 
    <span class="token punctuation">}</span>
    <span class="token keyword">return</span> sum
<span class="token punctuation">}</span>
<span class="token keyword">function</span> <span class="token function">fun2</span><span class="token punctuation">(</span><span class="token parameter">n</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> sum <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> sum1 <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> j <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> 
    <span class="token keyword">for</span><span class="token punctuation">(</span><span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> n<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">// &#x5FAA;&#x73AF;1</span>
        sum <span class="token operator">+=</span> i<span class="token punctuation">;</span> 
    <span class="token punctuation">}</span>
    <span class="token keyword">for</span><span class="token punctuation">(</span>i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> n<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">// &#x5FAA;&#x73AF;2</span>
        <span class="token keyword">for</span><span class="token punctuation">(</span>j <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> j <span class="token operator">&lt;=</span> n<span class="token punctuation">;</span> j<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> 
            sum <span class="token operator">+=</span> i <span class="token operator">*</span> j<span class="token punctuation">;</span> 
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">return</span> sum
<span class="token punctuation">}</span>
<span class="token keyword">function</span> <span class="token function">fun3</span><span class="token punctuation">(</span><span class="token parameter">n</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> sum <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> 
    <span class="token keyword">for</span><span class="token punctuation">(</span><span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> n<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> 
        sum <span class="token operator">+=</span> <span class="token function">fun</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span> 
    <span class="token punctuation">}</span>
    <span class="token keyword">return</span> sum
<span class="token punctuation">}</span>
</code></pre>
<p><code>fun1</code> &#x4E2D;&#x7B2C;1&#x884C;&#x90FD;&#x662F;&#x5E38;&#x91CF;&#xFF0C;&#x5BF9; n &#x7684;&#x5F71;&#x54CD;&#x4E0D;&#x5927;&#xFF0C;&#x6240;&#x4EE5;&#x603B;&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x8981;&#x770B;&#x7B2C;2&#x3001;3&#x884C;&#x7684;&#x5FAA;&#x73AF;&#xFF0C;&#x5373;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x4E3A;&#xFF1A; <code>O(n)</code> &#x3002;</p>
<p><code>fun2</code> &#x4E2D;&#x5FAA;&#x73AF;1&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x4E3A; O(n) &#xFF0C;&#x5FAA;&#x73AF;2&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x4E3A; O(n2)&#xFF0C;&#x5F53; n &#x8D8B;&#x4E8E;&#x65E0;&#x7A77;&#x5927;&#x65F6;&#xFF0C;&#x603B;&#x4F53;&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x8981;&#x8D8B;&#x4E8E; O(n2) &#xFF0C;&#x5373;&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x662F; O(n2)&#x3002;</p>
<p><code>fun3</code> &#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x662F; <code>O(n * T(fun)) = O(n*n)</code>&#xFF0C;&#x5373; O(n2) &#x3002;</p>
<p><strong>&#x6240;&#x4EE5;&#xFF1A;T(c+n)=O(n)&#xFF0C;T(m+n)=O(max(m, n))&#xFF0C;T(n) = T1(n) T2(m) = O(nm)&#xFF0C;&#x5176;&#x4E2D; c &#x4E3A;&#x5E38;&#x91CF;</strong></p>
<h5 id="&#x5E38;&#x89C1;&#x590D;&#x6742;&#x5EA6;&#xFF08;&#x6309;&#x6570;&#x91CF;&#x9636;&#x9012;&#x589E;&#xFF09;">&#x5E38;&#x89C1;&#x590D;&#x6742;&#x5EA6;&#xFF08;&#x6309;&#x6570;&#x91CF;&#x9636;&#x9012;&#x589E;&#xFF09;</h5>
<p><strong>&#x591A;&#x9879;&#x5F0F;&#x91CF;&#x7EA7;&#xFF1A;</strong></p>
<ul>
<li>&#x5E38;&#x91CF;&#x9636;&#xFF1A; O(1)&#xFF1A;&#x5F53;&#x7B97;&#x6CD5;&#x4E2D;&#x4E0D;&#x5B58;&#x5728;&#x5FAA;&#x73AF;&#x8BED;&#x53E5;&#x3001;&#x9012;&#x5F52;&#x8BED;&#x53E5;&#xFF0C;&#x5373;&#x4F7F;&#x6709;&#x6210;&#x5343;&#x4E0A;&#x4E07;&#x884C;&#x7684;&#x4EE3;&#x7801;&#xFF0C;&#x5176;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x4E5F;&#x662F;&#x39F;(1)</li>
<li>&#x5BF9;&#x6570;&#x9636;&#xFF1A;O(logn): &#x7B80;&#x5355;&#x4ECB;&#x7ECD;&#x4E00;&#x4E0B;</li>
</ul>
<pre class="language-"><code class="lang-js"><span class="token keyword">let</span> i<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>
<span class="token keyword">while</span> <span class="token punctuation">(</span>i <span class="token operator">&lt;=</span> n<span class="token punctuation">)</span>  <span class="token punctuation">{</span>
  i <span class="token operator">=</span> i <span class="token operator">*</span> <span class="token number">2</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<ul>
<li>&#x6BCF;&#x6B21;&#x5FAA;&#x73AF; <code>i</code> &#x90FD;&#x4E58;&#x4EE5; <code>2</code> &#xFF0C;&#x76F4;&#x81F3; <code>i &gt; n</code> &#xFF0C;&#x5373;&#x6267;&#x884C;&#x8FC7;&#x7A0B;&#x662F;&#xFF1A;20&#x3001;21&#x3001;22&#x3001;&#x2026;&#x3001;2k&#x3001;&#x2026;&#x3001;2x&#x3001; n
&#x6240;&#x4EE5;&#x603B;&#x6267;&#x884C;&#x6B21;&#x6570; x &#xFF0C;&#x53EF;&#x4EE5;&#x5199;&#x6210; 2x = n &#xFF0C;&#x5219;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x4E3A; O(log2n) &#x3002;&#x8FD9;&#x91CC;&#x662F; <code>2</code> &#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x662F;&#x5176;&#x4ED6;&#x5E38;&#x91CF; <code>k</code> &#xFF0C;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x4E5F;&#x662F;&#xFF1A; O(log3n) = O(log32 * log2n) = O(log2n)</li>
<li>&#x7EBF;&#x6027;&#x9636;&#xFF1A;O(n)</li>
<li>&#x7EBF;&#x6027;&#x5BF9;&#x6570;&#x9636;&#xFF1A;O(nlogn)</li>
<li>&#x5E73;&#x65B9;&#x9636;&#x3001;&#x7ACB;&#x65B9;&#x9636;&#x3001;&#x2026;.&#x3001;k&#x6B21;&#x65B9;&#x9636;&#xFF1A;O(n2)&#x3001;O(n3)&#x3001;&#x2026;&#x3001;O(nk)</li>
</ul>
<p><strong>&#x975E;&#x591A;&#x9879;&#x5F0F;&#x91CF;&#x9636;&#xFF1A;</strong></p>
<ul>
<li>&#x6307;&#x6570;&#x9636;&#xFF1A;O(2k)</li>
<li>&#x9636;&#x4E58;&#x9636;&#xFF1A;O(n!)</li>
</ul>
<h3 id="&#x56DB;&#x3001;&#x7A7A;&#x95F4;&#x590D;&#x6742;&#x5EA6;">&#x56DB;&#x3001;&#x7A7A;&#x95F4;&#x590D;&#x6742;&#x5EA6;</h3>
<p>&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x8868;&#x793A;&#x7B97;&#x6CD5;&#x7684;&#x6267;&#x884C;&#x65F6;&#x95F4;&#x4E0E;&#x6570;&#x636E;&#x89C4;&#x6A21;&#x4E4B;&#x95F4;&#x7684;&#x589E;&#x957F;&#x5173;&#x7CFB;&#x3002;&#x7C7B;&#x6BD4;&#x4E00;&#x4E0B;&#xFF0C;&#x7A7A;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x8868;&#x793A;&#x7B97;&#x6CD5;&#x7684;&#x5B58;&#x50A8;&#x7A7A;&#x95F4;&#x4E0E;&#x6570;&#x636E;&#x89C4;&#x6A21;&#x4E4B;&#x95F4;&#x7684;&#x589E;&#x957F;&#x5173;&#x7CFB;&#x3002;&#x4F8B;&#x5982;&#xFF1A;</p>
<pre class="language-"><code class="lang-js"><span class="token keyword">function</span> <span class="token function">fun</span><span class="token punctuation">(</span><span class="token parameter">n</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> a <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> n<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        a<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">return</span> a<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x4EE5;&#x4E0A;&#x4EE3;&#x7801;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x6E05;&#x6670;&#x7684;&#x770B;&#x51FA;&#x4EE3;&#x7801;&#x6267;&#x884C;&#x7684;&#x7A7A;&#x95F4;&#x4E3A; O(1+n) = O(n)&#xFF0C;&#x5373;&#x4E3A; i &#x53CA;&#x6570;&#x7EC4; a &#x5360;&#x7528;&#x7684;&#x50A8;&#x5B58;&#x7A7A;&#x95F4;&#x3002;</p>
<p>&#x6240;&#x4EE5;&#xFF0C;&#x7A7A;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x5206;&#x6790;&#x6BD4;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x5206;&#x6790;&#x8981;&#x7B80;&#x5355;&#x5F88;&#x591A;&#x3002;</p>
<h3 id="&#x4E94;&#x3001;&#x5E73;&#x5747;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;">&#x4E94;&#x3001;&#x5E73;&#x5747;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;</h3>
<p>&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x53D7;&#x6570;&#x636E;&#x672C;&#x8EAB;&#x5F71;&#x54CD;&#xFF0C;&#x8FD8;&#x5206;&#x4E3A;&#xFF1A;</p>
<ul>
<li>&#x6700;&#x597D;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#xFF1A;&#x5728;&#x6700;&#x7406;&#x60F3;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x6267;&#x884C;&#x8FD9;&#x6BB5;&#x4EE3;&#x7801;&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;</li>
<li>&#x6700;&#x574F;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#xFF1A;&#x5728;&#x6700;&#x7CDF;&#x7CD5;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x6267;&#x884C;&#x8FD9;&#x6BB5;&#x4EE3;&#x7801;&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;</li>
<li>&#x5E73;&#x5747;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#xFF1A;&#x6240;&#x6709;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x6C42;&#x4E00;&#x4E2A;&#x5E73;&#x5747;&#x503C;&#xFF0C;&#x53EF;&#x4EE5;&#x7701;&#x7565;&#x6389;&#x7CFB;&#x6570;&#x3001;&#x4F4E;&#x9636;&#x3001;&#x5E38;&#x91CF;</li>
</ul>
<h3 id="&#x516D;&#x3001;&#x53C2;&#x8003;&#x8D44;&#x6599;">&#x516D;&#x3001;&#x53C2;&#x8003;&#x8D44;&#x6599;</h3>
<p>&#x6781;&#x5BA2;&#x65F6;&#x95F4;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E0E;&#x7B97;&#x6CD5;&#x4E4B;&#x7F8E;</p>
<p><a href="https://book.douban.com/subject/26639401/" target="_blank">&#x5B66;&#x4E60;JavaScript&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E0E;&#x7B97;&#x6CD5;</a></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="前端算法.html" class="navigation navigation-prev " aria-label="Previous page: 前端算法">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="从Chrome V8源码看JavaScript数组.html" class="navigation navigation-next " aria-label="Next page: 从Chrome V8源码看JavaScript数组">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"统计算法的执行效率和资源消耗","level":"1.5.2","depth":2,"next":{"title":"从Chrome V8源码看JavaScript数组","level":"1.5.3","depth":2,"path":"Algorithm/从Chrome V8源码看JavaScript数组.md","ref":"Algorithm/从Chrome V8源码看JavaScript数组.md","articles":[]},"previous":{"title":"前端算法","level":"1.5.1","depth":2,"path":"Algorithm/前端算法.md","ref":"Algorithm/前端算法.md","articles":[]},"dir":"ltr"},"config":{"plugins":["github","donate","splitter","-anchor-navigation-ex","-sharing","sharing-plus","-highlight","prism","toggle-chapters","-lunr","-search","search-plus"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"css":["prismjs/themes/prism.css"]},"github":{"url":"https://github.com/MarioGogogo"},"splitter":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"donate":{"alipay":"","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"http://7q5c2h.com1.z0.glb.clouddn.com/wechatpay.JPG","wechatText":"微信打赏"},"fontsettings":{"theme":"white","family":"serif","size":2},"anchor-navigation-ex":{"associatedWithSummary":false,"showLevel":true,"multipleH1":true,"mode":"float","pageTop":{"showLevelIcon":false,"level1Icon":"fa fa-hand-o-right","level2Icon":"fa fa-hand-o-right","level3Icon":"fa fa-hand-o-right"}},"sharing":{"qq":false,"all":["weibo","qq","qzone","google","douban"],"douban":false,"facebook":false,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"toggle-chapters":{},"search-plus":{}},"theme":"default","author":"WuXiaolong","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"👨🏽‍💻前端漫游指南","language":"zh-hans","links":{"sidebar":{}},"gitbook":"3.2.3","description":"http://h5web.cc/"},"file":{"path":"Algorithm/统计算法的执行效率和资源消耗.md","mtime":"2020-04-16T16:01:57.881Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-04-22T01:16:46.955Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

